using System;
using System.Diagnostics;
using System.Windows.Forms;

namespace WindowsToolbox
{
    public partial class MainForm : Form
    {
        public MainForm()
        {
            InitializeComponent();
        }

        private void btnTaskManager_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("taskmgr.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法启动任务管理器: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnFileManager_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("explorer.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法启动文件管理器: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnScreenshot_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("SnippingTool.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法启动截图工具: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnPaint_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("mspaint.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法启动画图: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void btnCalculator_Click(object sender, EventArgs e)
        {
            try
            {
                Process.Start("calc.exe");
            }
            catch (Exception ex)
            {
                MessageBox.Show("无法启动计算器: " + ex.Message, "错误", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
    }
}
